package com.qf.day06;

/**
 * 写一个准寻javaBean规范的商品类型
 * ● 1、私有化属性
 * ● 2、对外提供公共的set、get方法
 * ● 3、提供有参无参构造
 */
public class Product {

    private String name;
    private double price;

    private String type;

    private int num;

    public Product() {
    }

    public Product(String name, double price, String type, int num) {
        this.name = name;
        this.price = price;
        this.type = type;
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "Product{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", num=" + num +
                '}';
    }
}
